#include <iostream>
#include <vector>
#include <stack>

using namespace std;
// 150. 逆波兰表达式求值

class Solution {
public:
    int evalRPN(vector<string>& tokens) {
        for(string& token : tokens) {
            if(token == "+" || token == "-" || token == "*" || token == "/") {
                int y = st.top();
                st.pop();
                int x = st.top();
                st.pop();
                int z = calc(x,y,token);
                st.push(z);
            } else {
                st.push(atoi(token.c_str()));   // 字符串转化为整数
            }
        }
        return st.top();
    }

private:
    stack<int> st;
    int calc(int x,int y,string& op) {
        if(op == "+") return x+y;
        if(op == "-") return x-y;
        if(op == "*") return x*y;
        if(op == "/") return x/y;
        return 0;
    }
};

int main() {
    std::cout << "Hello, World!" << std::endl;
    return 0;
}
